package io.github.uicdb.liba.api.register;

import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleType;

import java.util.function.Supplier;

public class ParticleTypeBuilder<T extends ParticleType<?> & ParticleOptions>{
    protected final LazyRegistry lazyRegistry;
    protected final String name;
    protected final Supplier<T> innerType;
    protected ParticleTypeHolder<T> result=new ParticleTypeHolder<>();
    public ParticleTypeBuilder(LazyRegistry lazyRegistry, String name, Supplier<T> innerType) {
        this.lazyRegistry = lazyRegistry;
        this.name = name;
        this.innerType = innerType;
    }
    public ParticleTypeHolder<T> build(){
        result.instance=lazyRegistry.particleTypes
                .register(name,innerType);
           return result;
    }

}
